package com.soft.javase.ch02.extendss;

/**
 * @author wangzhisen
 * @Desc 动物类 - 父类
 * @date 2025/4/17
 */
public class Animal {

    //属性
    private String name;
    private int age;
    private String color;

    //方法
    public void eat() {
        System.out.println("一只"+color+"的"+name+"正在吃饭...");
    }


    public Animal() {
    }

    public Animal(String name, int age, String color) {
        this.name = name;
        this.age = age;
        this.color = color;
    }

    /**
     * 获取
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取
     * @return age
     */
    public int getAge() {
        return age;
    }

    /**
     * 设置
     * @param age
     */
    public void setAge(int age) {
        this.age = age;
    }

    /**
     * 获取
     * @return color
     */
    public String getColor() {
        return color;
    }

    /**
     * 设置
     * @param color
     */
    public void setColor(String color) {
        this.color = color;
    }
}
